package com.hundsun.cprs.yyt.gateway.service.uc.impl;

import com.hundsun.cprs.yyt.gateway.enums.EnumFundBankNo;
import com.hundsun.cprs.yyt.service.common.dto.FundCloseInfo;
import com.hundsun.cprs.yyt.gateway.service.uc.BankBindingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hundsun.cprs.yyt.gateway.response.BaseResponse;
import com.hundsun.cprs.yyt.service.common.dto.FundOpenInfo;
import com.hundsun.cprs.yyt.service.common.service.RemoteTradeFundService;

/**
 * 模拟银行
 * @author linrl
 * @date 2018年3月28日
 */
@Service
public class MockBankBindingServiceImpl implements BankBindingService {

    @Autowired
    private RemoteTradeFundService remoteTradeFundService;
    
    @Override
    public String getBankNo() {
        return EnumFundBankNo.MOCK.getCode();
    }

    @Override
    public void bindingValidate(FundOpenInfo request,BaseResponse response) {
        //模拟银行，第一步直接开户即可
        binding(request,response);
    }

    @Override
    public void binding(FundOpenInfo request,BaseResponse response) {
        remoteTradeFundService.open(request);
    }

    @Override
    public void unBinding(FundCloseInfo request, BaseResponse response) {
        remoteTradeFundService.close(request);
    }

}
